Possible fix for the SEDF scheduler assertion problem.
authorjrb44@plym.cl.cam.ac.uk <jrb44@plym.cl.cam.ac.uk>
Mon, 3 Oct 2005 22:28:24 +0000 (23:28 +0100)
committerjrb44@plym.cl.cam.ac.uk <jrb44@plym.cl.cam.ac.uk>
Mon, 3 Oct 2005 22:28:24 +0000 (23:28 +0100)
Signed-off-by: Stephan Diestelhorst <Stephan.Diestelhorst@{cl.cam.ac.uk, inf.tu-dresden.de}>
xen/common/sched_sedf.c

index 1a498dcd30c61c17654451ada02a7ae8c3ba7858..b6b2f83c7155a69a9ef3b51be54c5dd798940ee0 100644 (file)
@@ -500,9 +500,15 @@ static inline void update_queues(s_time_t now, struct list_head* runq,
                   curinf->vcpu->domain->domain_id,
                   curinf->vcpu->vcpu_id);
             __del_from_queue(curinf->vcpu);
-   
+
             /*move them to their next period*/
             curinf->deadl_abs += curinf->period;
+            /*ensure that the start of the next period is in the future*/
+            if (unlikely(PERIOD_BEGIN(curinf) < now)) {
+                curinf->deadl_abs += 
+                    (DIV_UP(now - PERIOD_BEGIN(curinf),
+                           curinf->period)) * curinf->period;
+            }
             /*and put them back into the queue*/
             __add_to_waitqueue_sort(curinf->vcpu);
             continue;
@@ -645,7 +651,7 @@ static inline struct task_slice sedf_do_extra_schedule (s_time_t now,
                                                         s_time_t end_xt, struct list_head *extraq[], int cpu) {
     struct task_slice   ret;
     struct sedf_vcpu_info *runinf;
+    ASSERT(end_xt > now);
     /* Enough time left to use for extratime? */
     if (end_xt - now < EXTRA_QUANTUM)
         goto return_idle;